
import 'package:flutter/material.dart';
import 'package:flutter_deer/login/iview/user_perfect_iview.dart';
import 'package:flutter_deer/login/models/register_user_entity.dart';
import 'package:flutter_deer/mvp/base_page_presenter.dart';
import 'package:flutter_deer/net/base_entity.dart';
import 'package:flutter_deer/net/net.dart';
import 'package:flutter_deer/res/constant.dart';
import 'package:flutter_deer/util/other_utils.dart';
import 'package:sp_util/sp_util.dart';

class UserPerfectPagePresenter extends BasePagePresenter<UserPerfectIMvpView> {

  @override
  void initState() {
    // WidgetsBinding.instance.addPostFrameCallback((_) {});
  }

  Future<dynamic> updateUserPerfect(String? avatar,String? nickname) async {
    String phone = SpUtil.getString(Constant.phone).nullSafe;
    final UserPerfectEntity userPerfectEntity = UserPerfectEntity(phone: phone,avatar: avatar,nickname: nickname);
    await requestNetwork<OperatorBaseEntity>(Method.put,url: HttpApi.perfectUser,params: userPerfectEntity.toJson(), onSuccess: (data) {
      view.perfectResult(data!.data);
    },onError: (code,msg){});
  }


}